package hello.java.app2;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class Phone {
    public String number;
    public Object ownerID;
    // 参考PhoneState.java
    public int state;
    public String usn;
    public int level;
    public int callRegion;
    public String vncId;
    public int connectionState;
    public int protocol;
    public int configStatus;
    public int showType;
    public String stationId;
    public double longitude;
    public double latitude;
    public Object usageType;
    public Object owner;
    public String id;
    public String name;
    public String description;
    public Object path;
    public String lastUpdateTime;

    static ObjectMapper objectMapper = new ObjectMapper();

    @Override
    public String toString() {
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            return "phone:" + number + ";";
        }
    }
}
